package com.rpc.server;

import com.rpc.server.rpc.RpcServer;
import com.rpc.server.service.CalcService;
import com.rpc.server.service.impl.CalcServiceImpl;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

@SpringBootApplication
public class RpcServerApplication implements CommandLineRunner {

    public static void main(String[] args) {
        SpringApplication.run(RpcServerApplication.class);
    }

    @Override
    public void run(String... args) throws Exception {
        CalcService calcService = new CalcServiceImpl();
        new RpcServer().export(calcService, 1234);
    }
}
